home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / include / x11 / intrinsi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-11  |  5.9 KB  |  205 lines

  1. /* $XConsortium: IntrinsicI.h,v 1.48 91/06/27 13:24:18 converse Exp $ */
  2.  
  3. /***********************************************************
  4. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  5. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  6.  
  7.                         All Rights Reserved
  8.  
  9. Permission to use, copy, modify, and distribute this software and its 
  10. documentation for any purpose and without fee is hereby granted, 
  11. provided that the above copyright notice appear in all copies and that
  12. both that copyright notice and this permission notice appear in 
  13. supporting documentation, and that the names of Digital or MIT not be
  14. used in advertising or publicity pertaining to distribution of the
  15. software without specific, written prior permission.  
  16.  
  17. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  19. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  20. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  22. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  23. SOFTWARE.
  24.  
  25. ******************************************************************/
  26.  
  27. #ifndef _XtintrinsicI_h
  28. #define _XtintrinsicI_h
  29.  
  30. #include "Xtos.h"
  31. #include "IntrinsP.h"
  32. #include <X11/Xos.h>
  33.  
  34. #include "Object.h"
  35. #include "RectObj.h"
  36. #include "ObjectP.h"
  37. #include "RectObjP.h"
  38.  
  39. #include "TranslateI.h"
  40. #include "CallbackI.h"
  41. #include "ConvertI.h"
  42. #include "EventI.h"
  43. #include "PassivGraI.h"
  44. #include "InitialI.h"
  45. #include "ResourceI.h"
  46.  
  47. #define RectObjClassFlag    0x02
  48. #define WidgetClassFlag        0x04
  49. #define CompositeClassFlag    0x08
  50. #define ConstraintClassFlag    0x10
  51. #define ShellClassFlag        0x20
  52. #define WMShellClassFlag    0x40
  53. #define TopLevelClassFlag    0x80
  54.  
  55. /*
  56.  * The following macros, though very handy, are not suitable for
  57.  * IntrinsicP.h as they violate the rule that arguments are to
  58.  * be evaluated exactly once.
  59.  */
  60.  
  61. #define XtDisplayOfObject(object) \
  62.     ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \
  63.      ->core.screen->display)
  64.  
  65. #define XtScreenOfObject(object) \
  66.     ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \
  67.      ->core.screen)
  68.  
  69. #define XtWindowOfObject(object) \
  70.     ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \
  71.      ->core.window)
  72.  
  73. #define XtIsManaged(object) \
  74.     (XtIsRectObj(object) ? (object)->core.managed : False)
  75.  
  76. #define XtIsSensitive(object) \
  77.     (XtIsRectObj(object) ? ((object)->core.sensitive && \
  78.                 (object)->core.ancestor_sensitive) : False)
  79.  
  80.  
  81. /****************************************************************
  82.  *
  83.  * Byte utilities
  84.  *
  85.  ****************************************************************/
  86.  
  87. /* check for previous definition of copyfunc - DMD 06/04/94 */
  88. #ifndef __WATCOMC__
  89. #ifndef _XBCOPYFUNC
  90. #define _XBCOPYFUNC _XtBCopy
  91. #endif
  92. #else
  93. #define _XBCOPYFUNC _XtBCopy
  94. #endif
  95.  
  96. #include <X11/Xfuncs.h>
  97.  
  98. /* If the alignment characteristics of your machine are right, these may be
  99.    faster */
  100.  
  101. #ifdef UNALIGNED
  102.  
  103. #define XtBCopy(src, dst, size)                    \
  104.     if (size == sizeof(int))                    \
  105.     *((int *) (dst)) = *((int *) (src));            \
  106.     else if (size == sizeof(char))                \
  107.     *((char *) (dst)) = *((char *) (src));            \
  108.     else if (size == sizeof(short))                \
  109.     *((short *) (dst)) = *((short *) (src));        \
  110.     else                            \
  111.     bcopy((char *) (src), (char *) (dst), (int) (size));
  112.  
  113. #define XtBZero(dst, size)                    \
  114.     if (size == sizeof(int))                    \
  115.     *((int *) (dst)) = 0;                    \
  116.     else                            \
  117.     bzero((char *) (dst), (int) (size));
  118.  
  119. #define XtBCmp(b1, b2, size)                    \
  120.     (size == sizeof(int) ?                    \
  121.     *((int *) (b1)) != *((int *) (b2))            \
  122.     :   bcmp((char *) (b1), (char *) (b2), (int) (size))    \
  123.     )
  124.  
  125. #else
  126.  
  127. #define XtBCopy(src, dst, size)        \
  128.     bcopy((char *) (src), (char *) (dst), (int) (size));
  129.  
  130. #define XtBZero(dst, size) bzero((char *) (dst), (int) (size));
  131.  
  132. #define XtBCmp(b1, b2, size) bcmp((char *) (b1), (char *) (b2), (int) (size))
  133.  
  134. #endif
  135.  
  136.  
  137. /****************************************************************
  138.  *
  139.  * Stack cache allocation/free
  140.  *
  141.  ****************************************************************/
  142.  
  143. #define XtStackAlloc(size, stack_cache_array)     \
  144.     ((size) <= sizeof(stack_cache_array)      \
  145.     ?  (XtPointer)(stack_cache_array)          \
  146.     :  XtMalloc((unsigned)(size)))
  147.  
  148. #define XtStackFree(pointer, stack_cache_array) \
  149.     if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); else
  150.  
  151. /***************************************************************
  152.  *
  153.  * Filename defines
  154.  *
  155.  **************************************************************/
  156.  
  157. /* used by XtResolvePathname */
  158. #ifndef XFILESEARCHPATHDEFAULT
  159. #ifdef MSDOS
  160. #define XFILESEARCHPATHDEFAULT "~\\lib\\X11\\%L/%T/%N%S:~\\lib\\X11\\%l\\%T\\%N%S:~\\lib\\X11\\%T\\%N%S"
  161. #else
  162. #define XFILESEARCHPATHDEFAULT "/usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S"
  163. #endif
  164. #endif
  165.  
  166. /* the following two were both "X Toolkit " prior to R4 */
  167. #ifndef XTERROR_PREFIX
  168. #define XTERROR_PREFIX ""
  169. #endif
  170.  
  171. #ifndef XTWARNING_PREFIX
  172. #define XTWARNING_PREFIX ""
  173. #endif
  174.  
  175. #ifndef ERRORDB
  176. #define ERRORDB "/usr/lib/X11/XtErrorDB"
  177. #endif
  178.  
  179. extern String XtCXtToolkitError;
  180.  
  181. extern void _XtAllocError(
  182. #if NeedFunctionPrototypes
  183.     String    /* alloc_type */
  184. #endif
  185. );
  186.  
  187. extern void _XtCompileResourceList(
  188. #if NeedFunctionPrototypes
  189.     XtResourceList     /* resources */,
  190.     Cardinal         /* num_resources */
  191. #endif
  192. );
  193.  
  194. extern XtGeometryResult _XtMakeGeometryRequest(
  195. #if NeedFunctionPrototypes
  196.     Widget         /* widget */,
  197.     XtWidgetGeometry*    /* request */,
  198.     XtWidgetGeometry*    /* reply_return */,
  199.     Boolean*        /* clear_rect_obj */
  200. #endif
  201. );
  202.  
  203. #endif /* _XtintrinsicI_h */
  204. /* DON'T ADD STUFF AFTER THIS #endif */
  205.